package com.xbj.cloud;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author: 观雾
 * @create: 2024-08-30
 * @description:
 **/
@SpringBootApplication
@EnableDiscoveryClient //consul服务注册
public class Gateway9527Start {

    private static final Logger LOG =  LoggerFactory.getLogger(Gateway9527Start.class);

    public static void main(String[] args) {
        ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(Gateway9527Start.class, args);
        //返回一个包含当前活动配置文件名称的字符串数组。在Spring中，配置文件（如application.properties或application.yml）可以定义多个配置文件块，这些块被标记为特定的配置文件（profiles），如dev、test、prod等
        String[] activeProfiles = configurableApplicationContext.getEnvironment().getActiveProfiles();
        LOG.info("Gateway9527启动成功");
        for (String profile : activeProfiles) {
            LOG.info("当前使用的profile:"+profile);
        }
    }
}
